using System.Reflection;
using ITProf.Applications.pdb2gac.Enums;

namespace ITProf.Applications.pdb2gac.Attributes
{
    internal static class AttributeHelper
    {
        internal static T GetAttributeValue<T>(GacAssemblyProcessorArchitecture architecture)
        {
            MemberInfo[] members = typeof(GacAssemblyProcessorArchitecture).GetMember(architecture.ToString());
            return (T) members[0].GetCustomAttributes(typeof (T),
                                                      false)[0];
        }
    }
}